package com.joyance.test_servlet.common;


public enum ClassEnum {
    ServletConfig(1, "ServletConfig"),

    ServletContext(2, "ServletContext"),

    ServletRequest(3, "ServletRequest"),

    ServletResponse(4, "ServletResponse"),

    HttpServletRequest(5, "HttpServletRequest"),

    HttpServletResponse(6, "HttpServletResponse"),

    HttpSession(7, "HttpSession"),

    Cookie(9, "Cookie");

    int value;

    String name;




    public int getValue() {
        return value;
    }




    public void setValue(int value) {
        this.value = value;
    }




    public String getName() {
        return name;
    }




    public void setName(String name) {
        this.name = name;
    }



    private ClassEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }


    public static ClassEnum valueOf(int value) {
        switch (value) {
            case 1:
                return ServletConfig;
            case 2:
                return ServletContext;
            case 3:
                return ServletRequest;
            case 4:
                return ServletResponse;
            case 5:
                return HttpServletRequest;
            case 6:
                return HttpServletResponse;
            case 7:
                return HttpSession;
            case 9:
                return Cookie;
            default:
                break;
        }
        return null;
    }
}
